import { createRouter,createWebHistory,RouteRecordRaw } from "vue-router";

//createRouter(): 用于创建vue router 实例的函数
//createWebHistory(): 用于创建路由历史记录模式
//RouteRecordRaw():在路由中用于定义路由记录的类型
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'HelloWorld',
        component: () => import('../components/HelloWorld.vue')
    },
    {
        path: '/Login',
        name: 'Login',
        component: () => import('../components/Login.vue')
    },
    {
        path: '/Demo1',
        name: 'Demo1',
        component: () => import('../components/Demo1.vue')
    },
    {
        path: '/ShowStudent',
        name: 'ShowStudent',
        component: () => import('../components/ShowStudent.vue')
    },
    {
        path: '/Editinfo/:id',
        name: 'Editinfo',
        component: () => import('../components/Editinfo.vue')
    }




]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router